import React from "react";
import "./Footer.css"
export default class Footer extends React.Component{

    //声明状态、数据
    state = {
        footerArr:["关于我们","联系我们","招聘信息","商务合作","友情链接"],
        index:null
    }

    //创建更新  导航样式方法  实例对象
    changeFooter = (i) => {
        return ()=>{
            //更新数据
            this.setState({
                index:i
            })
        }
    }

    render(){
        return <div className="footer">
            <ul>
                {
                    this.state.footerArr.map((item,index) => {
                        return <li 
                            onClick={this.changeFooter(index)} 
                            className={this.state.index === index ? "bg" : null} 
                            key={index}
                        >{item}</li>
                    })
                }
                
                
            </ul>

        </div>
    }
}